﻿namespace QLPhongKham.UC
{
    using DevExpress.Data;
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Mask;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using QLPhongKham.Access;
    using QLPhongKham.Access.Duoc;
    using QLPhongKham.BaseClass.Duoc;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class ucd_khaibaotonkho : XtraUserControl
    {
        private long _idnhapkho;
        private int _iiddangnhap;
        private DKhaiBaoTonKho _nhapkho;
        private General _xuli;
        private SimpleButton btnboqua;
        private SimpleButton btnhuy;
        private SimpleButton btnin;
        private SimpleButton btnketthuc;
        private SimpleButton btnluu;
        private SimpleButton btnmoi;
        private SimpleButton btnsua;
        private SimpleButton btntim;
        private IContainer components;
        private DateEdit datedenngay;
        private DateEdit datengay;
        private DateEdit datetungay;
        private GridControl gridds;
        private GridColumn gridds_dongia;
        private GridColumn gridds_dvt;
        private GridColumn gridds_id;
        private GridColumn gridds_idtonct;
        private GridColumn gridds_ma;
        private GridColumn gridds_sltondau;
        private GridColumn gridds_slxuat;
        private GridColumn gridds_ten;
        private GridControl gridsp;
        private GridColumn gridsp_id;
        private GridColumn gridsp_ngay;
        private GridView gridView1;
        private GridView gridView2;
        private GroupControl groupControl1;
        private Label label25;
        private Label label26;
        private Label label27;
        private Label label3;
        private Label label8;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit2;
        private RepositoryItemTextEdit repositoryItemTextEdit3;
        private RepositoryItemTextEdit repositoryItemTextEdit4;

        public ucd_khaibaotonkho()
        {
            this._idnhapkho = 0L;
            this._iiddangnhap = 0;
            this.components = null;
            this.InitializeComponent();
            this._xuli = new General();
        }

        public ucd_khaibaotonkho(int iddangnhap)
        {
            this._idnhapkho = 0L;
            this._iiddangnhap = 0;
            this.components = null;
            this.InitializeComponent();
            this._xuli = new General();
            this._iiddangnhap = iddangnhap;
        }

        public ucd_khaibaotonkho(General xuli, int iddangnhap)
        {
            this._idnhapkho = 0L;
            this._iiddangnhap = 0;
            this.components = null;
            this.InitializeComponent();
            this._xuli = xuli;
            this._iiddangnhap = iddangnhap;
        }

        public ucd_khaibaotonkho(General xuli, long idnhapkho, int iddangnhap)
        {
            this._idnhapkho = 0L;
            this._iiddangnhap = 0;
            this.components = null;
            this.InitializeComponent();
            this._xuli = xuli;
            this._idnhapkho = idnhapkho;
            this._iiddangnhap = iddangnhap;
        }

        private void btnboqua_Click(object sender, EventArgs e)
        {
            this.f_Control_enable(false);
        }

        private void btnhuy_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dataSource = (DataTable) this.gridds.DataSource;
                dataSource.AcceptChanges();
                if (dataSource.Select(this.gridds_slxuat.FieldName + ">0").Length > 0)
                {
                    MessageBox.Show("Kh\x00f4ng cho ph\x00e9p hủy lần khai b\x00e1o tồn n\x00e0y.\nChi tiết phiếu n\x00e0y đ\x00e3 xuất kho.", "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
                else if (MessageBox.Show("Bạn chắc chắn muốn hủy lần khai b\x00e1o tồn n\x00e0y?", "Th\x00f4ng b\x00e1o", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.No)
                {
                    this._nhapkho.f_delete_tonkhoct(this.datengay.Text);
                    MessageBox.Show("Đ\x00e3 hủy th\x00e0nh c\x00f4ng.", "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    this.btnmoi_Click_1(null, null);
                    this.btnboqua_Click(null, null);
                    this.btntim_Click(null, null);
                }
            }
            catch
            {
            }
        }

        private void btnin_Click(object sender, EventArgs e)
        {
        }

        private void btnketthuc_Click(object sender, EventArgs e)
        {
            try
            {
                XtraTabPage parent = (XtraTabPage) base.Parent;
                XtraTabControl control = (XtraTabControl) parent.Parent;
                control.TabPages.Remove(parent);
            }
            catch
            {
                XtraUserControl control2 = (XtraUserControl) base.Parent;
                control2.Controls.Remove(this);
            }
        }

        private void btnluu_Click(object sender, EventArgs e)
        {
            if (this.f_kiemtra_thongtinphieu())
            {
                dtoDKhaiBaoTonKhoCT chitiet = new dtoDKhaiBaoTonKhoCT(this._xuli.pConFigData);
                DataTable dataSource = (DataTable) this.gridds.DataSource;
                dataSource.AcceptChanges();
                long num = 0L;
                string str = "";
                foreach (DataRow row in dataSource.Select(this.gridds_dongia.FieldName + ">0 or " + this.gridds_sltondau.FieldName + ">0"))
                {
                    string str2;
                    chitiet = new dtoDKhaiBaoTonKhoCT(this._xuli.pConFigData);
                    try
                    {
                        num = Convert.ToInt64(Convert.ToDecimal(row[this.gridds_idtonct.FieldName].ToString()));
                    }
                    catch
                    {
                        num = 0L;
                    }
                    chitiet.pID = num;
                    chitiet.pIDDANGNHAP = this._iiddangnhap;
                    chitiet.pSLTONDAU = int.Parse(row[this.gridds_sltondau.FieldName].ToString());
                    chitiet.pIDSANPHAM = int.Parse(row[this.gridds_id.FieldName].ToString());
                    chitiet.pNGAY = this.datengay.Text;
                    chitiet.pDONGIA = Convert.ToInt32(Convert.ToDecimal(row[this.gridds_dongia.FieldName].ToString()));
                    chitiet.pTENMAYTINH = Environment.MachineName;
                    if (num == 0L)
                    {
                        num = long.Parse(this._xuli.f_Get_CapID());
                        chitiet.pID = num;
                        if (!this._nhapkho.f_insert_tonkho(chitiet))
                        {
                            str2 = str;
                            str = str2 + row[this.gridds_ma.FieldName].ToString() + "  " + row[this.gridds_ten.FieldName].ToString() + "\n";
                        }
                    }
                    else if (!this._nhapkho.f_update_tonkho(chitiet))
                    {
                        str2 = str;
                        str = str2 + row[this.gridds_ma.FieldName].ToString() + "  " + row[this.gridds_ten.FieldName].ToString() + "\n";
                    }
                    chitiet = null;
                }
                if (str != "")
                {
                    MessageBox.Show("Kh\x00f4ng lưu được th\x00f4ng tin tồn kho.\n" + str, "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
                this._nhapkho.f_delete_tonkho();
                this.btntim_Click(null, null);
                this.f_Control_enable(false);
            }
        }

        private void btnmoi_Click_1(object sender, EventArgs e)
        {
            this.f_Control_enable(true);
            this.datengay.EditValue = DateTime.Now;
            this.f_loaddata_khaibaokhoct("");
            DataTable dataSource = (DataTable) this.gridds.DataSource;
            foreach (DataRow row in dataSource.Select(this.gridds_dongia.FieldName + ">0 or " + this.gridds_sltondau.FieldName + ">0"))
            {
                row[this.gridds_sltondau.FieldName] = 0;
                row[this.gridds_dongia.FieldName] = 0;
                row[this.gridds_idtonct.FieldName] = 0;
                try
                {
                    row["ngay"] = "";
                }
                catch
                {
                }
            }
            dataSource.AcceptChanges();
            this.gridds.DataSource = dataSource;
            base.ActiveControl = this.datengay;
        }

        private void btnsua_Click(object sender, EventArgs e)
        {
            this.f_Control_enable(true);
        }

        private void btntim_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable table = new DKhaiBaoTonKho(this._xuli.pConFigData).f_loaddata_khaibaotonkho_theongay(this.datetungay.Text, this.datedenngay.Text);
                this.gridsp.DataSource = table;
            }
            catch
            {
            }
            this.f_loadinfo_khaibaotonct(0);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void f_Control_enable(bool chophep)
        {
            this.btnluu.Enabled = this.btnboqua.Enabled = this.datengay.Enabled = chophep;
            this.btnhuy.Enabled = this.btnsua.Enabled = this.btnketthuc.Enabled = this.btnmoi.Enabled = this.gridView1.OptionsBehavior.ReadOnly = !chophep;
        }

        private bool f_kiemtra_thongtinphieu()
        {
            return true;
        }

        private void f_Loadcontrol_nhapkho(string ngay, int idkho)
        {
            try
            {
                this.datengay.EditValue = new DateTime(int.Parse(ngay.Substring(6, 4)), int.Parse(ngay.Substring(3, 2)), int.Parse(ngay.Substring(0, 2)), int.Parse(ngay.Substring(11, 2)), int.Parse(ngay.Substring(14, 2)), 0);
            }
            catch
            {
            }
        }

        private void f_loaddata_khaibaokhoct(string ngaygiokiemke)
        {
            DataTable table = this._nhapkho.f_loaddata_khaibaotonkho(ngaygiokiemke);
            this.gridds.DataSource = table;
        }

        private void f_loadinfo_khaibaotonct(int rowindex)
        {
            try
            {
                string ngaygiokiemke = this.gridView2.GetRowCellValue(rowindex, this.gridsp_ngay).ToString();
                this.f_loaddata_khaibaokhoct(ngaygiokiemke);
                this.datengay.EditValue = new DateTime(int.Parse(ngaygiokiemke.Substring(6, 4)), int.Parse(ngaygiokiemke.Substring(3, 2)), int.Parse(ngaygiokiemke.Substring(0, 2)), int.Parse(ngaygiokiemke.Substring(11, 2)), int.Parse(ngaygiokiemke.Substring(14, 2)), 0);
            }
            catch
            {
                this.f_loaddata_khaibaokhoct("");
            }
        }

        private void gridView1_CustomRowCellEdit(object sender, CustomRowCellEditEventArgs e)
        {
        }

        private void gridView1_CustomSummaryCalculate(object sender, CustomSummaryEventArgs e)
        {
        }

        private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            int num = 0;
            try
            {
                if (this.gridView1.IsFocusedView)
                {
                    num = this.gridView1.GetSelectedRows()[0];
                }
            }
            catch
            {
            }
        }

        private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;
                if (Convert.ToDecimal(view.GetRowCellValue(e.RowHandle, this.gridds_slxuat.FieldName).ToString()) > 0M)
                {
                    e.Appearance.ForeColor = Color.Red;
                }
            }
            catch
            {
            }
        }

        private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
        {
            try
            {
                if ((this.gridView1.FocusedColumn.FieldName == this.gridds_sltondau.FieldName) || (this.gridView1.FocusedColumn.FieldName == this.gridds_dongia.FieldName))
                {
                    decimal num = 0M;
                    try
                    {
                        num = Convert.ToDecimal(this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridds_slxuat).ToString());
                    }
                    catch
                    {
                    }
                    if (num > 0M)
                    {
                        e.Cancel = true;
                    }
                }
            }
            catch
            {
            }
        }

        private void gridView2_FocusedColumnChanged(object sender, FocusedColumnChangedEventArgs e)
        {
            this.gridView2_FocusedRowChanged(null, (FocusedRowChangedEventArgs) null);
        }

        private void gridView2_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            try
            {
                if (!this.btnluu.Enabled)
                {
                    int rowindex = this.gridView2.GetSelectedRows()[0];
                    if (rowindex >= 0)
                    {
                        this.f_loadinfo_khaibaotonct(rowindex);
                    }
                }
            }
            catch
            {
            }
        }

        private void gridView2_FocusedRowChanged(object sender, EventArgs e)
        {
            this.gridView2_FocusedRowChanged(null, (FocusedRowChangedEventArgs) null);
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(ucd_khaibaotonkho));
            StyleFormatCondition condition = new StyleFormatCondition();
            StyleFormatCondition condition2 = new StyleFormatCondition();
            this.gridds_dongia = new GridColumn();
            this.repositoryItemTextEdit2 = new RepositoryItemTextEdit();
            this.btnluu = new SimpleButton();
            this.btnsua = new SimpleButton();
            this.btnhuy = new SimpleButton();
            this.btnketthuc = new SimpleButton();
            this.gridView1 = new GridView();
            this.gridds_ma = new GridColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.gridds_ten = new GridColumn();
            this.gridds_dvt = new GridColumn();
            this.gridds_id = new GridColumn();
            this.gridds_sltondau = new GridColumn();
            this.gridds_idtonct = new GridColumn();
            this.gridds_slxuat = new GridColumn();
            this.gridds = new GridControl();
            this.btnboqua = new SimpleButton();
            this.label8 = new Label();
            this.datengay = new DateEdit();
            this.label3 = new Label();
            this.btnmoi = new SimpleButton();
            this.label25 = new Label();
            this.btnin = new SimpleButton();
            this.groupControl1 = new GroupControl();
            this.datetungay = new DateEdit();
            this.datedenngay = new DateEdit();
            this.label27 = new Label();
            this.label26 = new Label();
            this.btntim = new SimpleButton();
            this.gridsp = new GridControl();
            this.gridView2 = new GridView();
            this.gridsp_id = new GridColumn();
            this.gridsp_ngay = new GridColumn();
            this.repositoryItemTextEdit3 = new RepositoryItemTextEdit();
            this.repositoryItemTextEdit4 = new RepositoryItemTextEdit();
            this.repositoryItemTextEdit2.BeginInit();
            this.gridView1.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            this.gridds.BeginInit();
            this.datengay.Properties.VistaTimeProperties.BeginInit();
            this.datengay.Properties.BeginInit();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.datetungay.Properties.VistaTimeProperties.BeginInit();
            this.datetungay.Properties.BeginInit();
            this.datedenngay.Properties.VistaTimeProperties.BeginInit();
            this.datedenngay.Properties.BeginInit();
            this.gridsp.BeginInit();
            this.gridView2.BeginInit();
            this.repositoryItemTextEdit3.BeginInit();
            this.repositoryItemTextEdit4.BeginInit();
            base.SuspendLayout();
            this.gridds_dongia.AppearanceCell.ForeColor = Color.Blue;
            this.gridds_dongia.AppearanceCell.Options.UseForeColor = true;
            this.gridds_dongia.AppearanceHeader.ForeColor = Color.Blue;
            this.gridds_dongia.AppearanceHeader.Options.UseForeColor = true;
            this.gridds_dongia.Caption = "Đơn gi\x00e1";
            this.gridds_dongia.ColumnEdit = this.repositoryItemTextEdit2;
            this.gridds_dongia.FieldName = "dongia";
            this.gridds_dongia.Name = "gridds_dongia";
            this.gridds_dongia.Visible = true;
            this.gridds_dongia.VisibleIndex = 4;
            this.gridds_dongia.Width = 0x7c;
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.DisplayFormat.FormatString = "n0";
            this.repositoryItemTextEdit2.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit2.EditFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit2.Mask.EditMask = "n0";
            this.repositoryItemTextEdit2.Mask.MaskType = MaskType.Numeric;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            this.btnluu.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnluu.Appearance.Options.UseTextOptions = true;
            this.btnluu.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnluu.Image = Properties.Resources.imgsave;// (Image)manager.GetObject("btnluu.Image");
            this.btnluu.Location = new Point(90, 0x1d3);
            this.btnluu.Name = "btnluu";
            this.btnluu.Size = new Size(0x4b, 0x17);
            this.btnluu.TabIndex = 2;
            this.btnluu.Text = " &Lưu [F5]";
            this.btnluu.Click += new EventHandler(this.btnluu_Click);
            this.btnsua.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnsua.Appearance.Options.UseTextOptions = true;
            this.btnsua.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnsua.Image = Properties.Resources.imgedit;// (Image)manager.GetObject("btnsua.Image");
            this.btnsua.Location = new Point(0xa8, 0x1d3);
            this.btnsua.Name = "btnsua";
            this.btnsua.Size = new Size(0x4b, 0x17);
            this.btnsua.TabIndex = 4;
            this.btnsua.Text = " &Sửa [F3]";
            this.btnsua.Click += new EventHandler(this.btnsua_Click);
            this.btnhuy.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnhuy.Image = (Image) manager.GetObject("btnhuy.Image");
            this.btnhuy.Location = new Point(0x151, 0x1d3);
            this.btnhuy.Name = "btnhuy";
            this.btnhuy.Size = new Size(0x4b, 0x17);
            this.btnhuy.TabIndex = 6;
            this.btnhuy.Text = " &Hủy [F7]";
            this.btnhuy.Click += new EventHandler(this.btnhuy_Click);
            this.btnketthuc.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnketthuc.Appearance.Options.UseTextOptions = true;
            this.btnketthuc.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnketthuc.Image = Properties.Resources.imgclose;// (Image)manager.GetObject("btnketthuc.Image");
            this.btnketthuc.Location = new Point(0x3d0, 0x1d3);
            this.btnketthuc.Name = "btnketthuc";
            this.btnketthuc.Size = new Size(0x65, 0x17);
            this.btnketthuc.TabIndex = 7;
            this.btnketthuc.Text = " &Kết th\x00fac [F12]";
            this.btnketthuc.Click += new EventHandler(this.btnketthuc_Click);
            this.gridView1.Appearance.ColumnFilterButton.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.ColumnFilterButton.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.ColumnFilterButton.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseForeColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.BackColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.ColumnFilterButtonActive.BorderColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.ColumnFilterButtonActive.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true;
            this.gridView1.Appearance.Empty.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.Empty.BackColor2 = Color.White;
            this.gridView1.Appearance.Empty.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.BackColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.EvenRow.BorderColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.EvenRow.ForeColor = Color.Black;
            this.gridView1.Appearance.EvenRow.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.FilterCloseButton.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterPanel.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.FilterPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.FilterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.FixedLine.BackColor = Color.FromArgb(0x7a, 0x72, 0x71);
            this.gridView1.Appearance.FixedLine.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.BackColor = Color.White;
            this.gridView1.Appearance.FocusedCell.ForeColor = Color.Black;
            this.gridView1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.Options.UseForeColor = true;
            this.gridView1.Appearance.FocusedRow.BackColor = Color.FromArgb(200, 0xc0, 0x9d);
            this.gridView1.Appearance.FocusedRow.BorderColor = Color.FromArgb(0xe2, 0xdb, 0xbc);
            this.gridView1.Appearance.FocusedRow.ForeColor = Color.Black;
            this.gridView1.Appearance.FocusedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FooterPanel.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.FooterPanel.BorderColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.FooterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FooterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupButton.BackColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.GroupButton.BorderColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.GroupButton.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupFooter.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupFooter.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupFooter.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupPanel.BackColor = Color.FromArgb(0xf6, 0xf2, 0xd5);
            this.gridView1.Appearance.GroupPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.GroupPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupRow.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupRow.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupRow.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupRow.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HeaderPanel.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HeaderPanel.BorderColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HeaderPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.HeaderPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.HideSelectionRow.BackColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.HideSelectionRow.BorderColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.HideSelectionRow.ForeColor = Color.Black;
            this.gridView1.Appearance.HideSelectionRow.Options.UseBackColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HorzLine.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HorzLine.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.BorderColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.ForeColor = Color.Black;
            this.gridView1.Appearance.OddRow.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.OddRow.Options.UseForeColor = true;
            this.gridView1.Appearance.Preview.BackColor = Color.FromArgb(0xfb, 0xfc, 0xf7);
            this.gridView1.Appearance.Preview.Font = new Font("Verdana", 7.5f);
            this.gridView1.Appearance.Preview.ForeColor = Color.FromArgb(0x94, 0x94, 0x94);
            this.gridView1.Appearance.Preview.Options.UseBackColor = true;
            this.gridView1.Appearance.Preview.Options.UseFont = true;
            this.gridView1.Appearance.Preview.Options.UseForeColor = true;
            this.gridView1.Appearance.Row.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.Row.ForeColor = Color.Black;
            this.gridView1.Appearance.Row.Options.UseBackColor = true;
            this.gridView1.Appearance.Row.Options.UseForeColor = true;
            this.gridView1.Appearance.RowSeparator.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.RowSeparator.BackColor2 = Color.White;
            this.gridView1.Appearance.RowSeparator.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.BackColor = Color.FromArgb(0xdd, 0xd7, 0xbc);
            this.gridView1.Appearance.SelectedRow.BorderColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.SelectedRow.ForeColor = Color.Black;
            this.gridView1.Appearance.SelectedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.TopNewRow.BackColor = Color.White;
            this.gridView1.Appearance.TopNewRow.Options.UseBackColor = true;
            this.gridView1.Appearance.VertLine.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.VertLine.Options.UseBackColor = true;
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridds_ma, this.gridds_ten, this.gridds_dvt, this.gridds_id, this.gridds_sltondau, this.gridds_dongia, this.gridds_idtonct, this.gridds_slxuat });
            condition.Appearance.ForeColor = Color.Red;
            condition.Appearance.Options.UseForeColor = true;
            condition.Column = this.gridds_dongia;
            condition.Condition = FormatConditionEnum.Between;
            condition.Value1 = "0";
            condition.Value2 = "0";
            this.gridView1.FormatConditions.AddRange(new StyleFormatCondition[] { condition });
            this.gridView1.GridControl = this.gridds;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsBehavior.AllowAddRows = DefaultBoolean.True;
            this.gridView1.OptionsBehavior.AllowDeleteRows = DefaultBoolean.False;
            this.gridView1.OptionsView.AutoCalcPreviewLineCount = true;
            this.gridView1.OptionsView.EnableAppearanceEvenRow = true;
            this.gridView1.OptionsView.EnableAppearanceOddRow = true;
            this.gridView1.OptionsView.ShowAutoFilterRow = true;
            this.gridView1.OptionsView.ShowFooter = true;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridView1.RowCellStyle += new RowCellStyleEventHandler(this.gridView1_RowCellStyle);
            this.gridView1.CustomSummaryCalculate += new CustomSummaryEventHandler(this.gridView1_CustomSummaryCalculate);
            this.gridView1.ShowingEditor += new CancelEventHandler(this.gridView1_ShowingEditor);
            this.gridView1.FocusedRowChanged += new FocusedRowChangedEventHandler(this.gridView1_FocusedRowChanged);
            this.gridds_ma.Caption = "M\x00e3 số";
            this.gridds_ma.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ma.FieldName = "masp";
            this.gridds_ma.Name = "gridds_ma";
            this.gridds_ma.OptionsColumn.AllowEdit = false;
            this.gridds_ma.Summary.AddRange(new GridSummaryItem[] { new GridColumnSummaryItem(SummaryItemType.Count, "ma", "Tổng cộng={0:n0}") });
            this.gridds_ma.Visible = true;
            this.gridds_ma.VisibleIndex = 0;
            this.gridds_ma.Width = 0x71;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.repositoryItemTextEdit1.ReadOnly = true;
            this.gridds_ten.Caption = "T\x00ean sản phẩm";
            this.gridds_ten.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ten.FieldName = "tensp";
            this.gridds_ten.Name = "gridds_ten";
            this.gridds_ten.OptionsColumn.AllowEdit = false;
            this.gridds_ten.Visible = true;
            this.gridds_ten.VisibleIndex = 1;
            this.gridds_ten.Width = 460;
            this.gridds_dvt.Caption = "ĐVT";
            this.gridds_dvt.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_dvt.FieldName = "dvt";
            this.gridds_dvt.Name = "gridds_dvt";
            this.gridds_dvt.OptionsColumn.AllowEdit = false;
            this.gridds_dvt.Visible = true;
            this.gridds_dvt.VisibleIndex = 2;
            this.gridds_id.Caption = "id";
            this.gridds_id.FieldName = "idsp";
            this.gridds_id.Name = "gridds_id";
            this.gridds_sltondau.AppearanceCell.ForeColor = Color.Blue;
            this.gridds_sltondau.AppearanceCell.Options.UseForeColor = true;
            this.gridds_sltondau.AppearanceHeader.ForeColor = Color.Blue;
            this.gridds_sltondau.AppearanceHeader.Options.UseForeColor = true;
            this.gridds_sltondau.Caption = "Số lượng";
            this.gridds_sltondau.ColumnEdit = this.repositoryItemTextEdit2;
            this.gridds_sltondau.FieldName = "sltondau";
            this.gridds_sltondau.Name = "gridds_sltondau";
            this.gridds_sltondau.Visible = true;
            this.gridds_sltondau.VisibleIndex = 3;
            this.gridds_sltondau.Width = 0x8d;
            this.gridds_idtonct.Caption = "idtonct";
            this.gridds_idtonct.FieldName = "id";
            this.gridds_idtonct.Name = "gridds_idtonct";
            this.gridds_slxuat.Caption = "slxuat";
            this.gridds_slxuat.FieldName = "soluongxuat";
            this.gridds_slxuat.Name = "gridds_slxuat";
            this.gridds.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.gridds.Location = new Point(3, 0x4a);
            this.gridds.MainView = this.gridView1;
            this.gridds.Name = "gridds";
            this.gridds.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit1, this.repositoryItemTextEdit2 });
            this.gridds.Size = new Size(0x331, 0x183);
            this.gridds.TabIndex = 1;
            this.gridds.ViewCollection.AddRange(new BaseView[] { this.gridView1 });
            this.gridds.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.btnboqua.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnboqua.Image = Properties.Resources.imgundo;// (Image)manager.GetObject("btnboqua.Image");
            this.btnboqua.Location = new Point(0xf6, 0x1d3);
            this.btnboqua.Name = "btnboqua";
            this.btnboqua.Size = new Size(0x57, 0x17);
            this.btnboqua.TabIndex = 5;
            this.btnboqua.Text = " &Bỏ qua [F4]";
            this.btnboqua.Click += new EventHandler(this.btnboqua_Click);
            this.label8.Font = new Font("Tahoma", 10f);
            this.label8.Location = new Point(1, 0x30);
            this.label8.Name = "label8";
            this.label8.Size = new Size(0x76, 0x13);
            this.label8.TabIndex = 2;
            this.label8.Text = "Ng\x00e0y kiểm tồn:";
            this.label8.TextAlign = ContentAlignment.TopRight;
            this.datengay.EditValue = new DateTime(0x7dd, 11, 8, 2, 0x16, 9, 0x297);
            this.datengay.Location = new Point(120, 0x30);
            this.datengay.Name = "datengay";
            this.datengay.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.datengay.Properties.DisplayFormat.FormatString = "dd/MM/yyyy HH:mm";
            this.datengay.Properties.DisplayFormat.FormatType = FormatType.DateTime;
            this.datengay.Properties.EditFormat.FormatString = "dd/MM/yyyy HH:mm";
            this.datengay.Properties.EditFormat.FormatType = FormatType.DateTime;
            this.datengay.Properties.Mask.EditMask = "dd/MM/yyyy HH:mm";
            this.datengay.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.datengay.Size = new Size(0x7a, 20);
            this.datengay.TabIndex = 0;
            this.datengay.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label3.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label3.Font = new Font("Tahoma", 10f);
            this.label3.Location = new Point(0x1bc, 0x1d7);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x16, 0x13);
            this.label3.TabIndex = 2;
            this.label3.Text = "=";
            this.label3.TextAlign = ContentAlignment.TopRight;
            this.label3.Visible = false;
            this.btnmoi.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnmoi.Appearance.Options.UseTextOptions = true;
            this.btnmoi.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnmoi.Image = Properties.Resources.imgnew;// (Image)manager.GetObject("btnmoi.Image");
            this.btnmoi.Location = new Point(9, 0x1d3);
            this.btnmoi.Name = "btnmoi";
            this.btnmoi.Size = new Size(0x4b, 0x17);
            this.btnmoi.TabIndex = 3;
            this.btnmoi.Text = " &Mới [F2]";
            this.btnmoi.Click += new EventHandler(this.btnmoi_Click_1);
            this.label25.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.label25.BackColor = Color.Green;
            this.label25.Font = new Font("Tahoma", 16f);
            this.label25.ForeColor = Color.White;
            this.label25.Location = new Point(0, 0);
            this.label25.Name = "label25";
            this.label25.Size = new Size(0x43a, 0x2d);
            this.label25.TabIndex = 2;
            this.label25.Text = "KHAI B\x00c1O TỒN KHO";
            this.label25.TextAlign = ContentAlignment.MiddleLeft;
            this.btnin.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.btnin.Image = Properties.Resources.imgprint;// (Image)manager.GetObject("btnin.Image");
            this.btnin.Location = new Point(0x19e, 0x1d3);
            this.btnin.Name = "btnin";
            this.btnin.Size = new Size(0x3d, 0x17);
            this.btnin.TabIndex = 0x2b;
            this.btnin.Text = " &In";
            this.btnin.Visible = false;
            this.btnin.Click += new EventHandler(this.btnin_Click);
            this.groupControl1.Anchor = AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top;
            this.groupControl1.Appearance.Font = new Font("Tahoma", 10f);
            this.groupControl1.Appearance.Options.UseFont = true;
            this.groupControl1.AppearanceCaption.Font = new Font("Tahoma", 10f, FontStyle.Bold);
            this.groupControl1.AppearanceCaption.Options.UseFont = true;
            this.groupControl1.Controls.Add(this.datetungay);
            this.groupControl1.Controls.Add(this.datedenngay);
            this.groupControl1.Controls.Add(this.label27);
            this.groupControl1.Controls.Add(this.label26);
            this.groupControl1.Controls.Add(this.btntim);
            this.groupControl1.Controls.Add(this.gridsp);
            this.groupControl1.Location = new Point(0x336, 0x2f);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0xff, 0x19e);
            this.groupControl1.TabIndex = 0x2c;
            this.groupControl1.Text = "C\x00e1c lần khai b\x00e1o";
            this.datetungay.EditValue = new DateTime(0x7dd, 11, 8, 2, 0x16, 9, 0x297);
            this.datetungay.Location = new Point(0x21, 30);
            this.datetungay.Name = "datetungay";
            this.datetungay.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.datetungay.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
            this.datetungay.Properties.DisplayFormat.FormatType = FormatType.DateTime;
            this.datetungay.Properties.EditFormat.FormatString = "dd/MM/yyyy";
            this.datetungay.Properties.EditFormat.FormatType = FormatType.DateTime;
            this.datetungay.Properties.Mask.EditMask = "dd/MM/yyyy";
            this.datetungay.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.datetungay.Size = new Size(80, 20);
            this.datetungay.TabIndex = 0;
            this.datedenngay.EditValue = new DateTime(0x7dd, 11, 8, 2, 0x16, 9, 0x297);
            this.datedenngay.Location = new Point(0x91, 30);
            this.datedenngay.Name = "datedenngay";
            this.datedenngay.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.datedenngay.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
            this.datedenngay.Properties.DisplayFormat.FormatType = FormatType.DateTime;
            this.datedenngay.Properties.EditFormat.FormatString = "dd/MM/yyyy";
            this.datedenngay.Properties.EditFormat.FormatType = FormatType.DateTime;
            this.datedenngay.Properties.Mask.EditMask = "dd/MM/yyyy";
            this.datedenngay.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.datedenngay.Size = new Size(80, 20);
            this.datedenngay.TabIndex = 1;
            this.label27.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.label27.Font = new Font("Tahoma", 10f);
            this.label27.Location = new Point(0x6d, 30);
            this.label27.Name = "label27";
            this.label27.Size = new Size(0x23, 0x13);
            this.label27.TabIndex = 2;
            this.label27.Text = "đến:";
            this.label27.TextAlign = ContentAlignment.TopRight;
            this.label26.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.label26.Font = new Font("Tahoma", 10f);
            this.label26.Location = new Point(2, 30);
            this.label26.Name = "label26";
            this.label26.Size = new Size(30, 0x13);
            this.label26.TabIndex = 2;
            this.label26.Text = "Từ:";
            this.label26.TextAlign = ContentAlignment.TopRight;
            this.btntim.Image = (Image) manager.GetObject("btntim.Image");
            this.btntim.Location = new Point(0xe3, 30);
            this.btntim.Name = "btntim";
            this.btntim.Size = new Size(0x1a, 20);
            this.btntim.TabIndex = 2;
            this.btntim.Click += new EventHandler(this.btntim_Click);
            this.gridsp.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.gridsp.Location = new Point(4, 0x38);
            this.gridsp.MainView = this.gridView2;
            this.gridsp.Name = "gridsp";
            this.gridsp.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit3, this.repositoryItemTextEdit4 });
            this.gridsp.Size = new Size(0xf8, 0x166);
            this.gridsp.TabIndex = 3;
            this.gridsp.ViewCollection.AddRange(new BaseView[] { this.gridView2 });
            this.gridView2.Appearance.ColumnFilterButton.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.ColumnFilterButton.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.ColumnFilterButton.ForeColor = Color.Black;
            this.gridView2.Appearance.ColumnFilterButton.Options.UseBackColor = true;
            this.gridView2.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
            this.gridView2.Appearance.ColumnFilterButton.Options.UseForeColor = true;
            this.gridView2.Appearance.ColumnFilterButtonActive.BackColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView2.Appearance.ColumnFilterButtonActive.BorderColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView2.Appearance.ColumnFilterButtonActive.ForeColor = Color.Black;
            this.gridView2.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
            this.gridView2.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
            this.gridView2.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true;
            this.gridView2.Appearance.Empty.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.Empty.BackColor2 = Color.White;
            this.gridView2.Appearance.Empty.Options.UseBackColor = true;
            this.gridView2.Appearance.EvenRow.BackColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView2.Appearance.EvenRow.BorderColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView2.Appearance.EvenRow.ForeColor = Color.Black;
            this.gridView2.Appearance.EvenRow.Options.UseBackColor = true;
            this.gridView2.Appearance.EvenRow.Options.UseBorderColor = true;
            this.gridView2.Appearance.EvenRow.Options.UseForeColor = true;
            this.gridView2.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView2.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView2.Appearance.FilterCloseButton.ForeColor = Color.Black;
            this.gridView2.Appearance.FilterCloseButton.Options.UseBackColor = true;
            this.gridView2.Appearance.FilterCloseButton.Options.UseBorderColor = true;
            this.gridView2.Appearance.FilterCloseButton.Options.UseForeColor = true;
            this.gridView2.Appearance.FilterPanel.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.FilterPanel.BackColor2 = Color.White;
            this.gridView2.Appearance.FilterPanel.ForeColor = Color.Black;
            this.gridView2.Appearance.FilterPanel.Options.UseBackColor = true;
            this.gridView2.Appearance.FilterPanel.Options.UseForeColor = true;
            this.gridView2.Appearance.FixedLine.BackColor = Color.FromArgb(0x7a, 0x72, 0x71);
            this.gridView2.Appearance.FixedLine.Options.UseBackColor = true;
            this.gridView2.Appearance.FocusedCell.BackColor = Color.White;
            this.gridView2.Appearance.FocusedCell.ForeColor = Color.Black;
            this.gridView2.Appearance.FocusedCell.Options.UseBackColor = true;
            this.gridView2.Appearance.FocusedCell.Options.UseForeColor = true;
            this.gridView2.Appearance.FocusedRow.BackColor = Color.FromArgb(200, 0xc0, 0x9d);
            this.gridView2.Appearance.FocusedRow.BorderColor = Color.FromArgb(0xe2, 0xdb, 0xbc);
            this.gridView2.Appearance.FocusedRow.ForeColor = Color.Black;
            this.gridView2.Appearance.FocusedRow.Options.UseBackColor = true;
            this.gridView2.Appearance.FocusedRow.Options.UseBorderColor = true;
            this.gridView2.Appearance.FocusedRow.Options.UseForeColor = true;
            this.gridView2.Appearance.FooterPanel.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView2.Appearance.FooterPanel.BorderColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView2.Appearance.FooterPanel.ForeColor = Color.Black;
            this.gridView2.Appearance.FooterPanel.Options.UseBackColor = true;
            this.gridView2.Appearance.FooterPanel.Options.UseBorderColor = true;
            this.gridView2.Appearance.FooterPanel.Options.UseForeColor = true;
            this.gridView2.Appearance.GroupButton.BackColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView2.Appearance.GroupButton.BorderColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView2.Appearance.GroupButton.Options.UseBackColor = true;
            this.gridView2.Appearance.GroupButton.Options.UseBorderColor = true;
            this.gridView2.Appearance.GroupFooter.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.GroupFooter.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.GroupFooter.ForeColor = Color.Black;
            this.gridView2.Appearance.GroupFooter.Options.UseBackColor = true;
            this.gridView2.Appearance.GroupFooter.Options.UseBorderColor = true;
            this.gridView2.Appearance.GroupFooter.Options.UseForeColor = true;
            this.gridView2.Appearance.GroupPanel.BackColor = Color.FromArgb(0xf6, 0xf2, 0xd5);
            this.gridView2.Appearance.GroupPanel.BackColor2 = Color.White;
            this.gridView2.Appearance.GroupPanel.ForeColor = Color.Black;
            this.gridView2.Appearance.GroupPanel.Options.UseBackColor = true;
            this.gridView2.Appearance.GroupPanel.Options.UseForeColor = true;
            this.gridView2.Appearance.GroupRow.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.GroupRow.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.GroupRow.ForeColor = Color.Black;
            this.gridView2.Appearance.GroupRow.Options.UseBackColor = true;
            this.gridView2.Appearance.GroupRow.Options.UseBorderColor = true;
            this.gridView2.Appearance.GroupRow.Options.UseForeColor = true;
            this.gridView2.Appearance.HeaderPanel.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView2.Appearance.HeaderPanel.BorderColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView2.Appearance.HeaderPanel.ForeColor = Color.Black;
            this.gridView2.Appearance.HeaderPanel.Options.UseBackColor = true;
            this.gridView2.Appearance.HeaderPanel.Options.UseBorderColor = true;
            this.gridView2.Appearance.HeaderPanel.Options.UseForeColor = true;
            this.gridView2.Appearance.HideSelectionRow.BackColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView2.Appearance.HideSelectionRow.BorderColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView2.Appearance.HideSelectionRow.ForeColor = Color.Black;
            this.gridView2.Appearance.HideSelectionRow.Options.UseBackColor = true;
            this.gridView2.Appearance.HideSelectionRow.Options.UseBorderColor = true;
            this.gridView2.Appearance.HideSelectionRow.Options.UseForeColor = true;
            this.gridView2.Appearance.HorzLine.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView2.Appearance.HorzLine.Options.UseBackColor = true;
            this.gridView2.Appearance.OddRow.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView2.Appearance.OddRow.BorderColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView2.Appearance.OddRow.ForeColor = Color.Black;
            this.gridView2.Appearance.OddRow.Options.UseBackColor = true;
            this.gridView2.Appearance.OddRow.Options.UseBorderColor = true;
            this.gridView2.Appearance.OddRow.Options.UseForeColor = true;
            this.gridView2.Appearance.Preview.BackColor = Color.FromArgb(0xfb, 0xfc, 0xf7);
            this.gridView2.Appearance.Preview.Font = new Font("Verdana", 7.5f);
            this.gridView2.Appearance.Preview.ForeColor = Color.FromArgb(0x94, 0x94, 0x94);
            this.gridView2.Appearance.Preview.Options.UseBackColor = true;
            this.gridView2.Appearance.Preview.Options.UseFont = true;
            this.gridView2.Appearance.Preview.Options.UseForeColor = true;
            this.gridView2.Appearance.Row.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView2.Appearance.Row.ForeColor = Color.Black;
            this.gridView2.Appearance.Row.Options.UseBackColor = true;
            this.gridView2.Appearance.Row.Options.UseForeColor = true;
            this.gridView2.Appearance.RowSeparator.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView2.Appearance.RowSeparator.BackColor2 = Color.White;
            this.gridView2.Appearance.RowSeparator.Options.UseBackColor = true;
            this.gridView2.Appearance.SelectedRow.BackColor = Color.FromArgb(0xdd, 0xd7, 0xbc);
            this.gridView2.Appearance.SelectedRow.BorderColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView2.Appearance.SelectedRow.ForeColor = Color.Black;
            this.gridView2.Appearance.SelectedRow.Options.UseBackColor = true;
            this.gridView2.Appearance.SelectedRow.Options.UseBorderColor = true;
            this.gridView2.Appearance.SelectedRow.Options.UseForeColor = true;
            this.gridView2.Appearance.TopNewRow.BackColor = Color.White;
            this.gridView2.Appearance.TopNewRow.Options.UseBackColor = true;
            this.gridView2.Appearance.VertLine.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView2.Appearance.VertLine.Options.UseBackColor = true;
            this.gridView2.Columns.AddRange(new GridColumn[] { this.gridsp_id, this.gridsp_ngay });
            condition2.Appearance.ForeColor = Color.Red;
            condition2.Appearance.Options.UseForeColor = true;
            condition2.Condition = FormatConditionEnum.Between;
            condition2.Value1 = "0";
            condition2.Value2 = "0";
            this.gridView2.FormatConditions.AddRange(new StyleFormatCondition[] { condition2 });
            this.gridView2.GridControl = this.gridsp;
            this.gridView2.Name = "gridView2";
            this.gridView2.OptionsBehavior.AllowAddRows = DefaultBoolean.True;
            this.gridView2.OptionsBehavior.AllowDeleteRows = DefaultBoolean.False;
            this.gridView2.OptionsBehavior.ReadOnly = true;
            this.gridView2.OptionsView.AutoCalcPreviewLineCount = true;
            this.gridView2.OptionsView.EnableAppearanceEvenRow = true;
            this.gridView2.OptionsView.EnableAppearanceOddRow = true;
            this.gridView2.OptionsView.ShowAutoFilterRow = true;
            this.gridView2.OptionsView.ShowFooter = true;
            this.gridView2.OptionsView.ShowGroupPanel = false;
            this.gridView2.FocusedRowChanged += new FocusedRowChangedEventHandler(this.gridView2_FocusedRowChanged);
            this.gridsp_id.Caption = "id";
            this.gridsp_id.FieldName = "id";
            this.gridsp_id.Name = "gridsp_id";
            this.gridsp_ngay.Caption = "Ng\x00e0y";
            this.gridsp_ngay.FieldName = "ngay";
            this.gridsp_ngay.Name = "gridsp_ngay";
            this.gridsp_ngay.OptionsColumn.AllowEdit = false;
            this.gridsp_ngay.Visible = true;
            this.gridsp_ngay.VisibleIndex = 0;
            this.repositoryItemTextEdit3.AutoHeight = false;
            this.repositoryItemTextEdit3.Name = "repositoryItemTextEdit3";
            this.repositoryItemTextEdit3.ReadOnly = true;
            this.repositoryItemTextEdit4.AutoHeight = false;
            this.repositoryItemTextEdit4.DisplayFormat.FormatString = "n0";
            this.repositoryItemTextEdit4.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit4.EditFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit4.Mask.EditMask = "n0";
            this.repositoryItemTextEdit4.Mask.MaskType = MaskType.Numeric;
            this.repositoryItemTextEdit4.Name = "repositoryItemTextEdit4";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.groupControl1);
            base.Controls.Add(this.btnin);
            base.Controls.Add(this.datengay);
            base.Controls.Add(this.gridds);
            base.Controls.Add(this.btnketthuc);
            base.Controls.Add(this.btnhuy);
            base.Controls.Add(this.btnboqua);
            base.Controls.Add(this.btnsua);
            base.Controls.Add(this.btnluu);
            base.Controls.Add(this.btnmoi);
            base.Controls.Add(this.label3);
            base.Controls.Add(this.label25);
            base.Controls.Add(this.label8);
            base.Name = "ucd_khaibaotonkho";
            base.Size = new Size(0x439, 0x1ed);
            base.Load += new EventHandler(this.ucDMSanPham_Load);
            base.ControlRemoved += new ControlEventHandler(this.ucd_nhapkho_ControlRemoved);
            base.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.repositoryItemTextEdit2.EndInit();
            this.gridView1.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            this.gridds.EndInit();
            this.datengay.Properties.VistaTimeProperties.EndInit();
            this.datengay.Properties.EndInit();
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.datetungay.Properties.VistaTimeProperties.EndInit();
            this.datetungay.Properties.EndInit();
            this.datedenngay.Properties.VistaTimeProperties.EndInit();
            this.datedenngay.Properties.EndInit();
            this.gridsp.EndInit();
            this.gridView2.EndInit();
            this.repositoryItemTextEdit3.EndInit();
            this.repositoryItemTextEdit4.EndInit();
            base.ResumeLayout(false);
        }

        private void ucd_nhapkho_ControlRemoved(object sender, ControlEventArgs e)
        {
        }

        private void ucDMSanPham_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.F2)
            {
                if (this.btnmoi.Enabled)
                {
                    this.btnmoi_Click_1(null, null);
                }
            }
            else if (e.KeyCode == Keys.F3)
            {
                if (this.btnsua.Enabled)
                {
                    this.btnsua_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F4)
            {
                if (this.btnboqua.Enabled)
                {
                    this.btnboqua_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F5)
            {
                if (this.btnluu.Enabled)
                {
                    this.btnluu_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F7)
            {
                if (this.btnhuy.Enabled)
                {
                    this.btnhuy_Click(null, null);
                }
            }
            else if ((e.KeyCode == Keys.F12) && this.btnketthuc.Enabled)
            {
                this.btnketthuc_Click(null, null);
            }
        }

        private void ucDMSanPham_Load(object sender, EventArgs e)
        {
            this._nhapkho = new DKhaiBaoTonKho(this._xuli.pConFigData);
            this.btnboqua_Click(null, null);
            this.datedenngay.EditValue = this.datetungay.EditValue = this.datengay.EditValue = DateTime.Now;
            this.btntim_Click(null, null);
            this.datengay.Focus();
        }
    }
}

